// pages/canteen/manage/manage.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    menu: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let that = this
    wx.cloud.callFunction({
      name: 'lu',
      data: {
        action: 'meal',
        canteen_id: wx.getStorageSync('canteen_id'),
        window_id : wx.getStorageSync('window_id')
      },
      success(res) {
        let meal = res.result.data
        that.setData({
          menu: meal
        })
        console.log("云函数获取数据成功",meal)
      },
      fail(res) {
        console.log("函数获取数据失败",res)
      }
    })
  },

  onClickLeft() {
    wx.navigateBack()
  },

  // 上传饭菜
  goUploadMenu: function() {
    console.log("跳转到上传饭菜的页面")
    wx.navigateTo({
      url: '../uploadfool/uploadfool',
    })
  },
})